package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-13
 * Time: 13:19
 */
public class BookList {
    private Book[] books = new Book[10];
    private int bookNumber;

    public BookList() {
        books[0] = new Book("哈利波特", "J.K.罗琳", "小说",30);
        books[1] = new Book("三国演义", "罗贯中","小说", 35);
        books[2] = new Book("红楼梦", "曹雪芹", "小说",25);
        books[3] = new Book("鲁宾逊漂流记", "丹尼尔·笛福", "小说",40);
        this.bookNumber = 4;
    }

    public int getBookNumber() {
        return bookNumber;
    }

    public void setBookNumber(int bookNumber) {
        this.bookNumber = bookNumber;
    }

    public Book getBook(int index) {
        Book book = books[index];
        return book;
    }

    public void setBooks(Book book,int index) {
        books[index] = book;
    }
}